package org.example;

import org.example.bean.AppConfig1;
import org.example.bean.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.Environment;
import org.springframework.core.env.SystemEnvironmentPropertySource;

/**
 * Hello world!
 *
 */
public class App {
    public static void main( String[] args ) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(AppConfig1.class);
        context.setAllowCircularReferences(true);

        UserService userService = context.getBean("userService", UserService.class);
        //SystemEnvironmentPropertySource systemSource = context.getBean("systemEnvironmentPropertySource", SystemEnvironmentPropertySource.class);
        //Environment environment = context.getBean("environment", Environment.class);
        //Environment environment = context.getBean("environment", Environment.class);
        ConfigurableEnvironment environment = context.getEnvironment();
        context.getBeanFactoryPostProcessors();

        userService.test();
        System.out.println(userService);
        //System.out.println(systemSource);
        System.out.println(environment);

    }
}
